import axios from "../config.js";

/**
 * 分页查询交易订单
 * @returns {Promise<unknown>}
 */
export const findPage = data => {
  return axios({
    url: "/TransactLog/findPage",
    method: "get",
    params: data
  });
};

/**
 * 查询所有交易订单
 * @returns {Promise<unknown>}
 */
export const findAll = data => {
  return axios({
    url: "/TransactLog/findAll",
    method: "get",
    params: data
  });
};

/**
 * 通过交易订单分页查询
 * @returns {Promise<unknown>}
 */
export const findPageByName = data => {
  return axios({
    url: "/TransactLog/findPageByName",
    method: "get",
    params: data
  });
};

/**
 * 添加交易订单
 * @param data
 * @returns {Promise<unknown>}
 */
export const add = data => {
  return axios({
    url: "/TransactLog/add",
    method: "post",
    data
  });
};

/**
 * 更新交易订单信息
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const update = data => {
  return axios({
    url: "/TransactLog/update/" + data.id,
    method: "put",
    data
  });
};

/**
 * 删除交易订单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delTransactLog = data => {
  return axios({
    url: "/TransactLog/delete/" + data,
    method: "delete"
  });
};

/**
 * 删除选中交易订单
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const delMore = data => {
  return axios({
    url: "/TransactLog/deleteMore?ids=" + data,
    method: "delete"
  });
};
